<template>
    <div class="tab1" v-for="(item, index) of talentList" :key="index">
        <div class="company" @click="jump({ path: '/TalentDetail', query: { personId: item.personId } })">
            <div class="box">
                <div class="dv1">
                    <img v-if="item.sex == '女'" class="logo" src="@/assets/images/female.png" alt="">
                    <img v-else class="logo" src="@/assets/images/male.png" alt="">
                </div>
                <div class="dv2">
                    <div class="name1">{{item.name}}</div>
                    <div class="name2">{{item.occupation}}</div>
                    <div class="name3">{{item.talentCode}}</div>
                </div>
            </div>
            <div class="dv3">{{item.eduDegree}}</div>
        </div>
    </div>
</template>

<script setup>
import { ref, watch, toRefs, onMounted } from 'vue';
import { getTalentList } from '@/api/company.js';
import { useRouter } from 'vue-router';
const router = new useRouter();

const talentList = ref([])
const getTalent = async () => {
  const { code, data } = await getTalentList({
    currentPage: 1,
    pageSize: 20,
    companyId: "91321200MACTU4PJ4N" 
  });
  if (code === 200) {
    talentList.value = data.list;
  }
}
const jump = (options) => {
  router.push(options);
}

// const props = defineProps({
//     talentDataList: { type: Object, default: () => ([]) }
// })

// const emit = defineEmits([ 'jump' ]);
//   //  点击跳转
//   const jump = () => {
//     emit('jump');
//   }
onMounted(() => {
    getTalent()
})

</script>

<style lang="scss" scoped>
.tab1{
    padding: 1.2rem;
    background: #fff;
    display: flex;
    align-items: flex-start;
    justify-content:flex-start;
    margin: 1.2rem;
}
.company{
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    width: 100%;
}
.box{
    display: flex;
    justify-content: center;
    align-items: center;
}
.dv1{
    margin-right: 1rem;

    img{
        width: 5.6rem;
    }
}
.dv2{

    .name1{
        font-size: 1.8rem;
        font-weight: 700;
        margin-bottom: 0.9rem;
    }
    .name2{
        font-size: 1.4rem;
        font-weight: 400;
        margin-bottom: 0.3rem;
        color: #666666;
    }
     .name3{
        font-size: 1.4rem;
        font-weight: 400;
        color: #666666;
    }
}
.dv3{
    color: #666666;
    font-size: 1.4rem;
    font-weight: 400;
    margin-top: 0.5rem;
}




</style>